<template>
    <div class="goodsdesc-container">
        <!--标题-->
        <h3 class="title">{{goodsdesc.title}}</h3>
        <!--时间-->
        <p class="subtitle">
            <span>发表时间：{{goodsdesc.add_time | dateFormat}}</span>
            <span>点击：{{goodsdesc.click}}次</span>
        </p>
        <hr>
        <!--内容区域-->
        <div class="content" v-html="goodsdesc.content"></div>

    </div>
</template>
<script>
import {Toast} from 'mint-ui'
export default({
    data(){
        return{
            id:this.$route.params.id,
            goodsdesc:[]
        }
    },
    created(){
        this.getGODesc()
    },
    methods:{
        getGODesc(){
            this.$http.get("http://localhost:3000/news/?"+this.id).then(result=>{
                if(result.body){
                    this.goodsdesc=result.body[0]
                }else{
                    Toast('获取失败')
                }
                console.log(this.goodsdesc)
            })
        }
    }
})
</script>
<style lang="scss" scoped>
.goodsdesc-container{
    padding: 0 4px;
    .title{
        font-size:16px;
        text-align:center;
        margin:15px 0;
        color:red;
    }
    .subtitle {
        font-size:13px;
        color:#226aff;
        display: flex;
        justify-content: space-between;
    }
}
</style>
